<?php
if(!session_id()) { session_start(); }
if(!isset($_SESSION['user_type'])) {
	header('Location: index.php');
}
include_once('functions/main_functions.php');
	page_head();
?>
	<div id="main">
		<h2>Welcome to the Admin Interface</h2>
		<div id="content">
			<p><a href="user_manager.php">User Manager</a></p>
			<?php
			include_once('classes/portfolio.class.php');
			$portfolio = new Portfolio();
			$type = "Black Scholes";
			$nextType = "Binomial";
			if($portfolio->getCalculatorType() == 0) {
				$type = "Binomial";
				$nextType = "Black Scholes";
			}
			echo "<p>Calculator is currently set to $type. <a id='calculator-switch' onclick='switch_calculator(); return false;'>Switch to $nextType</a></p>";
			?>
			<form onsubmit="add_stock(); return false">
				<input type="text" placeholder="Stock Name" id="stock-name" /> <input type="text" placeholder="Stock Price" id="stock-price" /> <input type="submit" value="Add Stock" />
			</form>
		</div>
	</div>
<?php
	page_foot();
?>